package com.deke.order.controller;

import com.deke.order.service.QianOrderCourseService;
import com.deke.vo.Result;
import jdk.nashorn.internal.ir.annotations.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：Username 刘亦辰（59372312@qq.com）
 * @date ：Created in 2022/12/30 11:40
 * @description：
 * @modified By：
 * @version:
 **/

@RequestMapping("order/course")
@RestController
public class QianOrderCourseController {
    @Autowired
    QianOrderCourseService orderCourseService;
    
    /**
     * @create by: Username 刘亦辰 
     * @description:  根据课程id查询课程信息和老师名称
     * @create time: 2022/12/30 15:54
     * @param null 
     * @return :  
     **/
    @PostMapping("queryAllCourseAndTeacherName/{id}")
    public Result queryAllCourseAndTeacherName(@PathVariable String id){
     return    orderCourseService.queryAllCourseAndTeacherName(id);
    }
    
    /**
     * @create by: Username 刘亦辰 
     * @description: 根据课程id和会员手机判断该用户是否为讲师
     * @create time: 2022/12/30 15:55
     * @param null 
     * @return :  
     **/
    @PostMapping("queryMemberStatus/{id}/{mobileId}")
    public Result queryMemberStatus(@PathVariable String id,@PathVariable String mobileId){
        return orderCourseService.queryMemberStatus(id,mobileId);
    }
    
    /**
     * @create by: Username 刘亦辰 
     * @description: 根据课程id和当前用户手机号查询该视频是否为此讲师发布 
     * @create time: 2022/12/30 15:56
     * @param null 
     * @return :  
     **/
    @PostMapping("queryAllById/{id}/{mobileId}")
    public Result queryAllById(@PathVariable String id,@PathVariable String mobileId){
        return orderCourseService.queryAllById(id,mobileId);
    }

}